package com.justonetech.translation.domain.base;

import com.justonetech.system.domain.SysPerson;
import com.justonetech.translation.domain.Document;
import com.justonetech.translation.domain.Project;
import com.justonetech.translation.domain.Task;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;

import java.io.Serializable;


/**
 * This is an object that contains data related to the task table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 * TableComment : 任务
 * SyncTemplatepatterns : list\w*
 * SyncDao : false
 * TableName : 任务
 * SyncBoolean : get
 * SyncJsp : true
 * Treeable : false
 * Projectable : false
 *
 * @hibernate.class
 *  table="task"
 */
@JsonIgnoreProperties(value={"hibernateLazyInitializer"})
public abstract class BaseTask  implements Serializable{

	public static String REF = "Task";
	public static String PROP_STATUS = "status";
	public static String PROP_REVIEW_TEACHER = "reviewTeacher";
	public static String PROP_END_DATE = "endDate";
	public static String PROP_REVIEW_SUGESTION = "reviewSugestion";
	public static String PROP_REQUIREMENT = "requirement";
	public static String PROP_DOC = "doc";
	public static String PROP_PROJECT = "project";
	public static String PROP_START_DATE = "startDate";
	public static String PROP_TAG = "tag";
	public static String PROP_WORD_COUNT = "wordCount";
	public static String PROP_REWARD = "reward";
	public static String PROP_IS_ENTRUST = "isEntrust";
	public static String PROP_COMPLETE_DATE = "completeDate";
	public static String PROP_NAME = "name";
	public static String PROP_SIGN_DETAIL = "signDetail";
	public static String PROP_ID = "id";
	public static String PROP_TRANSLATOR = "translator";


	// constructors
	public BaseTask () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseTask (Long id) {
		this.setId(id);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private Long id;

	// fields
    /*任务名称*/
    /*任务名称*/
	private String name;
	
    /*任务标记*/
    /*任务标记*/
	private String tag;
	
    /*计划完成时间*/
    /*计划完成时间*/
	private java.sql.Date completeDate;
	
    /*任务开始时间*/
    /*任务开始时间*/
	private java.sql.Date startDate;
	
    /*任务结束时间*/
    /*任务结束时间*/
	private java.sql.Date endDate;
	
    /*翻译字数*/
    /*翻译字数*/
	private Integer wordCount;
	
    /*报酬(元)*/
    /*报酬(元)*/
	private Double reward;
	
    /*是否委托翻译*/
    /*是否委托翻译*/
	private Boolean isEntrust;
	
    /*状态*/
    /*状态*/
	private String status;
	
    /*翻译要求*/
    /*翻译要求*/
	private String requirement;
	
    /*分配明细*/
    /*分配明细*/
	private String signDetail;
	
    /*审稿老师*/
    /*审稿老师*/
	private String reviewTeacher;
	
    /*审稿意见*/
    /*审稿意见*/
	private String reviewSugestion;
	

	// many to one
	private Project project;
	private Document doc;
	private SysPerson translator;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="com.justonetech.core.orm.hibernate.LongIdGenerator"
     *  column="ID"
     */
	public Long getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 * @deprecated
	 */
	public void setId (Long id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: NAME
	 */
	public String getName () {
		return name;
	}

	/**
	 * Set the value related to the column: NAME
	 * @param name the NAME value
	 */
	public void setName (String name) {
		this.name = name;
	}


	/**
	 * Return the value associated with the column: TAG
	 */
	public String getTag () {
		return tag;
	}

	/**
	 * Set the value related to the column: TAG
	 * @param tag the TAG value
	 */
	public void setTag (String tag) {
		this.tag = tag;
	}


	/**
	 * Return the value associated with the column: COMPLETE_DATE
	 */
	public java.sql.Date getCompleteDate () {
		return completeDate;
	}

	/**
	 * Set the value related to the column: COMPLETE_DATE
	 * @param completeDate the COMPLETE_DATE value
	 */
	public void setCompleteDate (java.sql.Date completeDate) {
		this.completeDate = completeDate;
	}


	/**
	 * Return the value associated with the column: START_DATE
	 */
	public java.sql.Date getStartDate () {
		return startDate;
	}

	/**
	 * Set the value related to the column: START_DATE
	 * @param startDate the START_DATE value
	 */
	public void setStartDate (java.sql.Date startDate) {
		this.startDate = startDate;
	}


	/**
	 * Return the value associated with the column: END_DATE
	 */
	public java.sql.Date getEndDate () {
		return endDate;
	}

	/**
	 * Set the value related to the column: END_DATE
	 * @param endDate the END_DATE value
	 */
	public void setEndDate (java.sql.Date endDate) {
		this.endDate = endDate;
	}


	/**
	 * Return the value associated with the column: WORD_COUNT
	 */
	public Integer getWordCount () {
		return wordCount;
	}

	/**
	 * Set the value related to the column: WORD_COUNT
	 * @param wordCount the WORD_COUNT value
	 */
	public void setWordCount (Integer wordCount) {
		this.wordCount = wordCount;
	}


	/**
	 * Return the value associated with the column: REWARD
	 */
	public Double getReward () {
		return reward;
	}

	/**
	 * Set the value related to the column: REWARD
	 * @param reward the REWARD value
	 */
	public void setReward (Double reward) {
		this.reward = reward;
	}


    public Boolean getIsEntrust() {
        return isEntrust;
    }

    public void setIsEntrust(Boolean entrust) {
        isEntrust = entrust;
    }

    /**
	 * Return the value associated with the column: STATUS
	 */
	public String getStatus () {
		return status;
	}

	/**
	 * Set the value related to the column: STATUS
	 * @param status the STATUS value
	 */
	public void setStatus (String status) {
		this.status = status;
	}


	/**
	 * Return the value associated with the column: REQUIREMENT
	 */
	public String getRequirement () {
		return requirement;
	}

	/**
	 * Set the value related to the column: REQUIREMENT
	 * @param requirement the REQUIREMENT value
	 */
	public void setRequirement (String requirement) {
		this.requirement = requirement;
	}


	/**
	 * Return the value associated with the column: SIGN_DETAIL
	 */
	public String getSignDetail () {
		return signDetail;
	}

	/**
	 * Set the value related to the column: SIGN_DETAIL
	 * @param signDetail the SIGN_DETAIL value
	 */
	public void setSignDetail (String signDetail) {
		this.signDetail = signDetail;
	}


	/**
	 * Return the value associated with the column: REVIEW_TEACHER
	 */
	public String getReviewTeacher () {
		return reviewTeacher;
	}

	/**
	 * Set the value related to the column: REVIEW_TEACHER
	 * @param reviewTeacher the REVIEW_TEACHER value
	 */
	public void setReviewTeacher (String reviewTeacher) {
		this.reviewTeacher = reviewTeacher;
	}


	/**
	 * Return the value associated with the column: REVIEW_SUGESTION
	 */
	public String getReviewSugestion () {
		return reviewSugestion;
	}

	/**
	 * Set the value related to the column: REVIEW_SUGESTION
	 * @param reviewSugestion the REVIEW_SUGESTION value
	 */
	public void setReviewSugestion (String reviewSugestion) {
		this.reviewSugestion = reviewSugestion;
	}


	/**
	 * Return the value associated with the column: DOC_ID
	 */
	public Document getDoc () {
		return doc;
	}

	/**
	 * Set the value related to the column: DOC_ID
	 * @param doc the DOC_ID value
	 */
	public void setDoc (Document doc) {
		this.doc = doc;
	}


	/**
	 * Return the value associated with the column: TRANSLATOR
	 */
	public SysPerson getTranslator () {
		return translator;
	}



    /**
	 * Set the value related to the column: TRANSLATOR
	 * @param translator the TRANSLATOR value
	 */
	public void setTranslator (SysPerson translator) {
		this.translator = translator;
	}

    public Project getProject() {
        return project;
    }

    public void setProject(Project project) {
        this.project = project;
    }

	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof Task)) return false;
		else {
			Task task = (Task) obj;
			if (null == this.getId() || null == task.getId()) return false;
			else return (this.getId().equals(task.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		ToStringBuilder builder = new ToStringBuilder(this);
		builder.append(id);
		builder.append(name);
		builder.append(tag);
		builder.append(completeDate);
		builder.append(startDate);
		builder.append(endDate);
		builder.append(wordCount);
		builder.append(reward);
		builder.append(isEntrust);
		builder.append(status);
		builder.append(requirement);
		builder.append(signDetail);
		builder.append(reviewTeacher);
		builder.append(reviewSugestion);
		return builder.toString();
	}


}